home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / system / pc_dcl.zip / HELP / CLOSE.HTX < prev    next >
Text File  |  1992-01-08  |  2KB  |  81 lines

  1. CLOSE
  2.  
  3.  CLOSE
  4.  
  5.     Closes a file that was opened for input  or  output  with  the  OPEN
  6.     command,  and deassigns the logical name specified when the file was
  7.     opened.
  8.  
  9.     Format:
  10.  
  11.  
  12.       CLOSE  logical-name[:]
  13.  
  14.  
  15.  
  16.     Additional information :
  17.  
  18.        logical-name close.logical-name     /ERROR close.logical-name     /LOG close./log
  19.        Examples close.examples
  20.  
  21.  
  22. close.logical-name
  23.  
  24.  CLOSE
  25.  
  26.      logical-name[:]
  27.  
  28.       Specifies the logical name assigned to the file when it  was  opened
  29.       with the OPEN command.
  30.  
  31.  
  32.      /ERROR=label
  33.  
  34.      Specifies a label in the command procedure to receive control  if  an
  35.       error  occurs  when  you are closing a file that was opened with the
  36.       OPEN command.  The error routine specified for this qualifier  takes
  37.       precedence over any action statement indicated in an ON command.  If
  38.       /ERROR is not specified and an error occurs during  the  closing  of
  39.       the file, the current ON condition action is taken.
  40.  
  41.       If an error occurs  and  the  target  label  is  successfully  given
  42.       control,  the  global  symbol $STATUS retains the code for the error
  43.       that caused the error path to be taken.
  44.  
  45.  
  46. close./log
  47.  
  48.  CLOSE
  49.  
  50.  
  51.     /LOG
  52.  
  53.       Controls whether a warning message is generated when you attempt  to
  54.       close  a file that was not opened by DCL.  If you specify the /ERROR
  55.       qualifier, the /LOG qualifier has no effect.  If the  file  has  not
  56.       been  opened  by  DCL,  the  error branch is taken and no message is
  57.       displayed.
  58.  
  59. close.examples
  60.  
  61.   Examples
  62.  
  63.  
  64.       1.   $ OPEN/READ INPUT_FILE   TEST.DAT
  65.            $ READ_LOOP:
  66.            $ READ/END_OF_FILE=NO_MORE  INPUT_FILE  DATA_LINE
  67.               .
  68.               .
  69.               .
  70.            $ GOTO READ_LOOP
  71.            $ NO_MORE:
  72.            $ CLOSE INPUT_FILE
  73.  
  74.       The OPEN command opens the file TEST.DAT and assigns it the  logical
  75.       name  of INPUT_FILE.  The /END_OF_FILE qualifier on the READ command
  76.       requests  that,  when  the  end-of-file  is  reached,  the   command
  77.       interpreter  should  transfer  control  to  the  line  at  the label
  78.       NO_MORE.  The CLOSE command closes the input file.
  79. 
  80.  
  81.